<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<div id="app">
    <h2>1：迭代数组</h2>
    <ul>
        <li v-for="item in emps">
            {{ item.name}} -- {{ item.salary}}
        </li>
    </ul>

    <h2>2：迭代对象</h2>
    <ul>
        <li v-for="(value,key,index) in emps[0]">
            {{key}} --{{value}}
        </li>

    </ul>
</div>

<script src="node_modules/vue/dist/vue.js"></script>
<script>
    new Vue({
        el: '#app',
        data: {
            emps: [
                {name: '马云', salary: '20000'},
                {name: '马云', salary: '20000'},
                {name: '马云', salary: '20000'}
            ]
        }
    });
</script>
</body>
</html>
